package cn.com.blueInfo.bpm.system.convert;

import cn.com.blueInfo.bpm.common.convert.BaseConvert;
import cn.com.blueInfo.bpm.system.entity.DynamicForm;
import cn.com.blueInfo.bpm.system.request.DynamicFormDTO;
import cn.com.blueInfo.bpm.system.response.DynamicFormVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

/**
 * 动态表单表 对象转换
 * @author suxch
 * @since 2025-08-31 16:20:56
 */
@Mapper(componentModel = "spring")
public interface DynamicFormConvert
        extends BaseConvert<DynamicForm, DynamicFormDTO, DynamicFormVO> {

    DynamicForm dtoToEntity(DynamicFormDTO dto);

    DynamicForm dtoToEntity(DynamicFormDTO.UpdatePartialDTO dto);

    @Mapping(source = "status", target = "status", qualifiedByName = "enumToDesc")
    @Mapping(source = "deleted", target = "deleted", qualifiedByName = "enumToDesc")
    @Mapping(source = "formType", target = "formType", qualifiedByName = "enumToDesc")
    DynamicFormVO entityToVO(DynamicForm entity);

}